3.12.58 \(\int \frac {(A+B x) (d+e x)^2}{a+c x^2} \, dx\)

Optimal. Leaf size=108 \[ \frac {\tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right ) \left (-a A e^2-2 a B d e+A c d^2\right )}{\sqrt {a} c^{3/2}}+\frac {\log \left (a+c x^2\right ) \left (-a B e^2+2 A c d e+B c d^2\right )}{2 c^2}+\frac {e x (A e+2 B d)}{c}+\frac {B e^2 x^2}{2 c} \]

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {801, 635, 205, 260} \begin {gather*} \frac {\log \left (a+c x^2\right ) \left (-a B e^2+2 A c d e+B c d^2\right )}{2 c^2}+\frac {\tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right ) \left (-a A e^2-2 a B d e+A c d^2\right )}{\sqrt {a} c^{3/2}}+\frac {e x (A e+2 B d)}{c}+\frac {B e^2 x^2}{2 c} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((A + B*x)*(d + e*x)^2)/(a + c*x^2),x]

[Out]

(e*(2*B*d + A*e)*x)/c + (B*e^2*x^2)/(2*c) + ((A*c*d^2 - 2*a*B*d*e - a*A*e^2)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqr
t[a]*c^(3/2)) + ((B*c*d^2 + 2*A*c*d*e - a*B*e^2)*Log[a + c*x^2])/(2*c^2)

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 801

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
(d + e*x)^m*(f + g*x))/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

Rubi steps

\begin {align*} \int \frac {(A+B x) (d+e x)^2}{a+c x^2} \, dx &=\int \left (\frac {e (2 B d+A e)}{c}+\frac {B e^2 x}{c}+\frac {A c d^2-2 a B d e-a A e^2+\left (B c d^2+2 A c d e-a B e^2\right ) x}{c \left (a+c x^2\right )}\right ) \, dx\\ &=\frac {e (2 B d+A e) x}{c}+\frac {B e^2 x^2}{2 c}+\frac {\int \frac {A c d^2-2 a B d e-a A e^2+\left (B c d^2+2 A c d e-a B e^2\right ) x}{a+c x^2} \, dx}{c}\\ &=\frac {e (2 B d+A e) x}{c}+\frac {B e^2 x^2}{2 c}+\frac {\left (A c d^2-2 a B d e-a A e^2\right ) \int \frac {1}{a+c x^2} \, dx}{c}+\frac {\left (B c d^2+2 A c d e-a B e^2\right ) \int \frac {x}{a+c x^2} \, dx}{c}\\ &=\frac {e (2 B d+A e) x}{c}+\frac {B e^2 x^2}{2 c}+\frac {\left (A c d^2-2 a B d e-a A e^2\right ) \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{\sqrt {a} c^{3/2}}+\frac {\left (B c d^2+2 A c d e-a B e^2\right ) \log \left (a+c x^2\right )}{2 c^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.09, size = 99, normalized size = 0.92 \begin {gather*} \frac {\log \left (a+c x^2\right ) \left (-a B e^2+2 A c d e+B c d^2\right )-\frac {2 \sqrt {c} \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right ) \left (a A e^2+2 a B d e-A c d^2\right )}{\sqrt {a}}+c e x (2 A e+4 B d+B e x)}{2 c^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((A + B*x)*(d + e*x)^2)/(a + c*x^2),x]

[Out]

(c*e*x*(4*B*d + 2*A*e + B*e*x) - (2*Sqrt[c]*(-(A*c*d^2) + 2*a*B*d*e + a*A*e^2)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/Sq
rt[a] + (B*c*d^2 + 2*A*c*d*e - a*B*e^2)*Log[a + c*x^2])/(2*c^2)

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(A+B x) (d+e x)^2}{a+c x^2} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[((A + B*x)*(d + e*x)^2)/(a + c*x^2),x]

[Out]

IntegrateAlgebraic[((A + B*x)*(d + e*x)^2)/(a + c*x^2), x]

________________________________________________________________________________________

fricas [A]  time = 0.42, size = 235, normalized size = 2.18 \begin {gather*} \left [\frac {B a c e^{2} x^{2} + {\left (A c d^{2} - 2 \, B a d e - A a e^{2}\right )} \sqrt {-a c} \log \left (\frac {c x^{2} + 2 \, \sqrt {-a c} x - a}{c x^{2} + a}\right ) + 2 \, {\left (2 \, B a c d e + A a c e^{2}\right )} x + {\left (B a c d^{2} + 2 \, A a c d e - B a^{2} e^{2}\right )} \log \left (c x^{2} + a\right )}{2 \, a c^{2}}, \frac {B a c e^{2} x^{2} + 2 \, {\left (A c d^{2} - 2 \, B a d e - A a e^{2}\right )} \sqrt {a c} \arctan \left (\frac {\sqrt {a c} x}{a}\right ) + 2 \, {\left (2 \, B a c d e + A a c e^{2}\right )} x + {\left (B a c d^{2} + 2 \, A a c d e - B a^{2} e^{2}\right )} \log \left (c x^{2} + a\right )}{2 \, a c^{2}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(e*x+d)^2/(c*x^2+a),x, algorithm="fricas")

[Out]

[1/2*(B*a*c*e^2*x^2 + (A*c*d^2 - 2*B*a*d*e - A*a*e^2)*sqrt(-a*c)*log((c*x^2 + 2*sqrt(-a*c)*x - a)/(c*x^2 + a))
 + 2*(2*B*a*c*d*e + A*a*c*e^2)*x + (B*a*c*d^2 + 2*A*a*c*d*e - B*a^2*e^2)*log(c*x^2 + a))/(a*c^2), 1/2*(B*a*c*e
^2*x^2 + 2*(A*c*d^2 - 2*B*a*d*e - A*a*e^2)*sqrt(a*c)*arctan(sqrt(a*c)*x/a) + 2*(2*B*a*c*d*e + A*a*c*e^2)*x + (
B*a*c*d^2 + 2*A*a*c*d*e - B*a^2*e^2)*log(c*x^2 + a))/(a*c^2)]

________________________________________________________________________________________

giac [A]  time = 0.16, size = 101, normalized size = 0.94 \begin {gather*} \frac {{\left (A c d^{2} - 2 \, B a d e - A a e^{2}\right )} \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c} c} + \frac {{\left (B c d^{2} + 2 \, A c d e - B a e^{2}\right )} \log \left (c x^{2} + a\right )}{2 \, c^{2}} + \frac {B c x^{2} e^{2} + 4 \, B c d x e + 2 \, A c x e^{2}}{2 \, c^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(e*x+d)^2/(c*x^2+a),x, algorithm="giac")

[Out]

(A*c*d^2 - 2*B*a*d*e - A*a*e^2)*arctan(c*x/sqrt(a*c))/(sqrt(a*c)*c) + 1/2*(B*c*d^2 + 2*A*c*d*e - B*a*e^2)*log(
c*x^2 + a)/c^2 + 1/2*(B*c*x^2*e^2 + 4*B*c*d*x*e + 2*A*c*x*e^2)/c^2

________________________________________________________________________________________

maple [A]  time = 0.05, size = 148, normalized size = 1.37 \begin {gather*} -\frac {A a \,e^{2} \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c}\, c}+\frac {A \,d^{2} \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c}}-\frac {2 B a d e \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c}\, c}+\frac {B \,e^{2} x^{2}}{2 c}+\frac {A d e \ln \left (c \,x^{2}+a \right )}{c}+\frac {A \,e^{2} x}{c}-\frac {B a \,e^{2} \ln \left (c \,x^{2}+a \right )}{2 c^{2}}+\frac {B \,d^{2} \ln \left (c \,x^{2}+a \right )}{2 c}+\frac {2 B d e x}{c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)*(e*x+d)^2/(c*x^2+a),x)

[Out]

1/2*B/c*e^2*x^2+1/c*e^2*A*x+2/c*e*B*d*x+1/c*ln(c*x^2+a)*A*d*e-1/2/c^2*ln(c*x^2+a)*B*a*e^2+1/2/c*ln(c*x^2+a)*B*
d^2-1/c/(a*c)^(1/2)*arctan(1/(a*c)^(1/2)*c*x)*A*a*e^2+1/(a*c)^(1/2)*arctan(1/(a*c)^(1/2)*c*x)*A*d^2-2/c/(a*c)^
(1/2)*arctan(1/(a*c)^(1/2)*c*x)*a*B*d*e

________________________________________________________________________________________

maxima [A]  time = 1.27, size = 100, normalized size = 0.93 \begin {gather*} \frac {{\left (A c d^{2} - 2 \, B a d e - A a e^{2}\right )} \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c} c} + \frac {B e^{2} x^{2} + 2 \, {\left (2 \, B d e + A e^{2}\right )} x}{2 \, c} + \frac {{\left (B c d^{2} + 2 \, A c d e - B a e^{2}\right )} \log \left (c x^{2} + a\right )}{2 \, c^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(e*x+d)^2/(c*x^2+a),x, algorithm="maxima")

[Out]

(A*c*d^2 - 2*B*a*d*e - A*a*e^2)*arctan(c*x/sqrt(a*c))/(sqrt(a*c)*c) + 1/2*(B*e^2*x^2 + 2*(2*B*d*e + A*e^2)*x)/
c + 1/2*(B*c*d^2 + 2*A*c*d*e - B*a*e^2)*log(c*x^2 + a)/c^2

________________________________________________________________________________________

mupad [B]  time = 0.14, size = 114, normalized size = 1.06 \begin {gather*} \frac {x\,\left (A\,e^2+2\,B\,d\,e\right )}{c}+\frac {\ln \left (c\,x^2+a\right )\,\left (-4\,B\,a^2\,c^2\,e^2+4\,B\,a\,c^3\,d^2+8\,A\,a\,c^3\,d\,e\right )}{8\,a\,c^4}-\frac {\mathrm {atan}\left (\frac {\sqrt {c}\,x}{\sqrt {a}}\right )\,\left (-A\,c\,d^2+2\,B\,a\,d\,e+A\,a\,e^2\right )}{\sqrt {a}\,c^{3/2}}+\frac {B\,e^2\,x^2}{2\,c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*x)*(d + e*x)^2)/(a + c*x^2),x)

[Out]

(x*(A*e^2 + 2*B*d*e))/c + (log(a + c*x^2)*(4*B*a*c^3*d^2 - 4*B*a^2*c^2*e^2 + 8*A*a*c^3*d*e))/(8*a*c^4) - (atan
((c^(1/2)*x)/a^(1/2))*(A*a*e^2 - A*c*d^2 + 2*B*a*d*e))/(a^(1/2)*c^(3/2)) + (B*e^2*x^2)/(2*c)

________________________________________________________________________________________

sympy [B]  time = 1.41, size = 425, normalized size = 3.94 \begin {gather*} \frac {B e^{2} x^{2}}{2 c} + x \left (\frac {A e^{2}}{c} + \frac {2 B d e}{c}\right ) + \left (- \frac {- 2 A c d e + B a e^{2} - B c d^{2}}{2 c^{2}} - \frac {\sqrt {- a c^{5}} \left (A a e^{2} - A c d^{2} + 2 B a d e\right )}{2 a c^{4}}\right ) \log {\left (x + \frac {2 A a c d e - B a^{2} e^{2} + B a c d^{2} - 2 a c^{2} \left (- \frac {- 2 A c d e + B a e^{2} - B c d^{2}}{2 c^{2}} - \frac {\sqrt {- a c^{5}} \left (A a e^{2} - A c d^{2} + 2 B a d e\right )}{2 a c^{4}}\right )}{A a c e^{2} - A c^{2} d^{2} + 2 B a c d e} \right )} + \left (- \frac {- 2 A c d e + B a e^{2} - B c d^{2}}{2 c^{2}} + \frac {\sqrt {- a c^{5}} \left (A a e^{2} - A c d^{2} + 2 B a d e\right )}{2 a c^{4}}\right ) \log {\left (x + \frac {2 A a c d e - B a^{2} e^{2} + B a c d^{2} - 2 a c^{2} \left (- \frac {- 2 A c d e + B a e^{2} - B c d^{2}}{2 c^{2}} + \frac {\sqrt {- a c^{5}} \left (A a e^{2} - A c d^{2} + 2 B a d e\right )}{2 a c^{4}}\right )}{A a c e^{2} - A c^{2} d^{2} + 2 B a c d e} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(e*x+d)**2/(c*x**2+a),x)

[Out]

B*e**2*x**2/(2*c) + x*(A*e**2/c + 2*B*d*e/c) + (-(-2*A*c*d*e + B*a*e**2 - B*c*d**2)/(2*c**2) - sqrt(-a*c**5)*(
A*a*e**2 - A*c*d**2 + 2*B*a*d*e)/(2*a*c**4))*log(x + (2*A*a*c*d*e - B*a**2*e**2 + B*a*c*d**2 - 2*a*c**2*(-(-2*
A*c*d*e + B*a*e**2 - B*c*d**2)/(2*c**2) - sqrt(-a*c**5)*(A*a*e**2 - A*c*d**2 + 2*B*a*d*e)/(2*a*c**4)))/(A*a*c*
e**2 - A*c**2*d**2 + 2*B*a*c*d*e)) + (-(-2*A*c*d*e + B*a*e**2 - B*c*d**2)/(2*c**2) + sqrt(-a*c**5)*(A*a*e**2 -
 A*c*d**2 + 2*B*a*d*e)/(2*a*c**4))*log(x + (2*A*a*c*d*e - B*a**2*e**2 + B*a*c*d**2 - 2*a*c**2*(-(-2*A*c*d*e +
B*a*e**2 - B*c*d**2)/(2*c**2) + sqrt(-a*c**5)*(A*a*e**2 - A*c*d**2 + 2*B*a*d*e)/(2*a*c**4)))/(A*a*c*e**2 - A*c
**2*d**2 + 2*B*a*c*d*e))

________________________________________________________________________________________